<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="../includes/importer.jsp"%>
<!doctype html>
<html>
<head>
<ht:head />

<script type="text/javascript">
//删除
function checkDel(el){


	if($("input[name='groupId']:checked").length == 0 ){
		 alert("请选择需要删除的群组");
		 return false;
	 }
	 var str=""; 
	 $("input[name='groupId']:checked").each(function(){  
	 	str+=$(this).val()+",";  
	 })
	 dealInfo("确认删除","delete?groupId="+str);
}

</script>




	<script type="text/javascript">
  $().ready(function() {
		$(".view").click(function() {
			var id = $(this).attr("id");
			showDialog("会员列表", 
			"${ctx }/member/list?&groupName="+id,function(doc){},
			{"Width":1000,"Height":1000,"ShowMessageRow":false,"ShowButtonRow":false});
	});
	});

	</script>


</head>
<body>
	<br />
	<div id="search-menu">
		<ul>
			<ht:menu-btn type="search" />
			<ct:display model="grade_list" btn="add_btn">
				<ht:menu-btn text="添加群组" url="/grade/gradeAdd" />
			</ct:display>
		</ul>
		<br style="clear: left" />
	</div>
	<div class="queryContainer">
		<form name="queryForm" id="queryForm" action="?" method="get">
			<table>
				<tr>
				<td width="70">群组：</td>
                <td width="300"><input type="text" name="groupName" value="${param.groupName}" class="txt" style="width:206px"/></td>

						<td width="70">审核状态：</td>
					<td width="200"><select name="status">
							<option value="">--请选择--</option>
							<c:forEach items="${statusMap}" var="item" varStatus="index">
								<option value="${item.key }"
									<c:if test="${item.key == param.status}">selected="selected"</c:if>>${item.value}</option>
							</c:forEach>
					</select>
					</td>
					
						<td><ct:btn type="search" />
					</td>
				</tr>
				
			</table>
		</form>
	</div>
	

	<div class="container">
		<br />
		<h3>共有${pageData.recordCount }条记录</h3>
		<div class="mainbox">
			<c:if test="${not empty pageData}">
				<table class="datalist fixwgroupIdth">
					<colgroup>
			        	<col wgroupIdth="300"></col>
			        	<col wgroupIdth="300"></col>
			        	<col wgroupIdth="300"></col>
			        	<col wgroupIdth="300"></col>
			        	<col wgroupIdth="400"></col>
        			</colgroup>
					 <tr>
			        	<td colspan="5" align="left">
			      
			        	<ct:display model="grade_list" btn="del_btn">
			        		<ht:table-action-btn text="删除" url="/grade/delete"    onAction="checkDel"/>
			        	</ct:display>
			        	</td>
        			</tr>
					<tr>

				<th nowrap="nowrap" wgroupIdth="300"><input type="checkbox"  class="checkall" />编号</th>
						<th nowrap="nowrap" wgroupIdth="300">群组</th>
						<th nowrap="nowrap" wgroupIdth="300">创建时间</th>
						<th nowrap="nowrap" wgroupIdth="300">审核状态</th>
						<th nowrap="nowrap" wgroupIdth="400">操作</th>
					</tr>

					<c:forEach items="${pageData.data}" var="item">
						<tr>
						<td nowrap="nowrap" ><input type="checkbox"  name="groupId" value="${item.groupId }" />${item.groupId}</td>
						<td nowrap="nowrap" class="ellipsis">${item.groupName}</td>
				       <td><ct:time source="${item.createTime}" />	</td>
						<td nowrap="nowrap" class="ellipsis">${item.statusName}</td>
								<td nowrap="nowrap">
<!--							    <ct:display model="grade_list" btn="view_btn">-->
<!--								 	<a href="view/${item.groupId}"  class="view">详情</a>&nbsp; &nbsp;-->
<!--								</ct:display>-->
			
								<ct:display model="grade_list" btn="mod_btn">
									<a href="gradeUpdate/${item.groupId}">编辑</a>&nbsp; &nbsp;
								</ct:display>


                          <ct:display model="member_list" btn="view_btn">
								 
								 	
								 		 <a href="#this" id="${item.groupName}" class="view">查看</a>
								</ct:display>

								<c:if test="${item.status ==0 }">
									<ct:display model="grade_list" btn="st_forbidden_btn">
											 <a href="#" onclick="dealInfo('确定要启用吗？',' memberLnitiate?id=${item.groupId}');">启用</a>&nbsp; &nbsp;
		                        	</ct:display>
		                        	</c:if>
		                        	
		                        		<c:if test="${item.status ==1 }">
									<ct:display model="grade_list" btn="st_activate_btn">
											    <a href="#" onclick="dealInfo('确定要禁用吗？',' memberLnitiate?id=${item.groupId}');">禁用</a>&nbsp; &nbsp;
		                        	</ct:display>
		                        	</c:if>
								
								<c:if test="${item.status !=-1 }">
					<ct:display model="grade_list" btn="del_btn">
             <a href="#this" onclick="deleteItem(' ${ctx}/grade/memberDel/${item.groupId}');">删除</a>
                   	</ct:display>
						</c:if>
							</td>
						</tr>
					</c:forEach>
				</table>
				<ht:page pageData="${pageData}" />
			</c:if>
			<c:if test="${empty pageData.data}">
				<div class="note">
					<p class="i">目前没有相关记录!</p>
				</div>
			</c:if>
		</div>
	</div>
</body>
</html>